﻿<UserControl x:Class="Meridian.Views.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Properties="clr-namespace:Meridian.Properties" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Background="White"
             Loaded="UserControlLoaded">
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="UserControl.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SettingsHeader" Storyboard.TargetProperty="Opacity">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1">
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <ExponentialEase EasingMode="EaseOut" Exponent="6"/>
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SettingsHeader" Storyboard.TargetProperty="(RenderTransform).X">
                            <EasingDoubleKeyFrame KeyTime="0" Value="-20"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-20"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0">
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <ExponentialEase EasingMode="EaseOut" Exponent="6"/>
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SettingsTabControl" Storyboard.TargetProperty="(RenderTransform).X">
                            <EasingDoubleKeyFrame KeyTime="0" Value="-20"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <ExponentialEase EasingMode="EaseOut" Exponent="6"/>
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetName="SettingsTabControl" Storyboard.TargetProperty="Opacity" DecelerationRatio="0.3">
                            <LinearDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SettingsTabControl" Storyboard.TargetProperty="(RenderTransform).X" DecelerationRatio="0.3">
                            <LinearDoubleKeyFrame KeyTime="0:0:0.2" Value="-30"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>-->
                    </Storyboard>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </UserControl.Triggers>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <TextBlock Name="SettingsHeader"  Text="{x:Static Properties:Resources.Settings}" FontSize="21" Margin="10,0,0,0" FontFamily="../Fonts/#Segoe WP Light">
            <TextBlock.RenderTransform>
                <TranslateTransform />
            </TextBlock.RenderTransform>
        </TextBlock>
        <TabControl Name="SettingsTabControl" Margin="20,50,20,10" TabStripPlacement="Left" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="12">
            <TabControl.RenderTransform>
                <TranslateTransform />
            </TabControl.RenderTransform>
            <TabItem Header="{x:Static Properties:Resources.GeneralTabHeader}">
                <ScrollViewer>
                    <StackPanel>
                        <TextBlock Text="{x:Static Properties:Resources.LoadOptions}" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="20" Foreground="Black"/>
                        <TextBlock Name="FirstLoadCountTextBlock" Text="{x:Static Properties:Resources.FirstLoadCount}" FontFamily="../Fonts/#Segoe WP" Foreground="Black" Margin="0,10,0,0" TextWrapping="Wrap"/>
                        <Slider Name="FirstLoadCountSlider" Style="{StaticResource MetroSlider}" HorizontalAlignment="Left" IsMoveToPointEnabled="True" Foreground="{StaticResource AccentColor}" Background="LightGray" Value="20" Maximum="200"
                                Width="200" ValueChanged="FirstLoadCountSliderValueChanged"/>
                        <TextBlock Name="DynamicLoadCountTextBlock" Text="{x:Static Properties:Resources.DynamicLoadCount}" FontFamily="../Fonts/#Segoe WP" Foreground="Black" Margin="0,15,0,0" TextWrapping="Wrap"/>
                        <Slider Name="DynamicLoadCountSlider" Style="{StaticResource MetroSlider}" HorizontalAlignment="Left" IsMoveToPointEnabled="True" Foreground="{StaticResource AccentColor}" Background="LightGray" Value="20" Maximum="200"
                                Width="200" ValueChanged="DynamicLoadCountSliderValueChanged"/>
                        <TextBlock Text="{x:Static Properties:Resources.AccentColor}" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="20" Foreground="Black" Margin="0,20,0,0"/>
                        <ComboBox Name="AccentColorBox" Style="{StaticResource MetroComboBox}" SnapsToDevicePixels="True" HorizontalAlignment="Left" Width="200" SelectionChanged="AccentColorBoxSelectionChanged">
                            <ComboBoxItem Content="Default"/>
                            <ComboBoxItem Content="Green"/>
                            <ComboBoxItem Content="Mango"/>
                            <ComboBoxItem Content="Pink"/>
                            <ComboBoxItem Content="Red"/>
                        </ComboBox>
                        <TextBlock Text="{x:Static Properties:Resources.Language}" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="20" Foreground="Black" Margin="0,20,0,0"/>
                        <ComboBox Name="LanguageBox" Style="{StaticResource MetroComboBox}" SnapsToDevicePixels="True" HorizontalAlignment="Left" Width="200" SelectionChanged="LanguageComboBoxSelectionChanged"/>
                        <TextBlock Text="{x:Static Properties:Resources.SettingsUpdates}" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="20" Foreground="Black" Margin="0,20,0,0"/>
                        <CheckBox Name="AutoUpdateCheckBox" Margin="0,10,0,0">
                            <TextBlock Text="{x:Static Properties:Resources.SettingsAutoUpdate}" FontFamily="../Fonts/#Segoe WP" Foreground="Black" TextWrapping="Wrap"/>
                        </CheckBox>
                        <Button Name="CheckButton" Content="{x:Static Properties:Resources.SettingsCheckUpdates}" HorizontalAlignment="Left"
                            Margin="0,5,0,0" FontFamily="../Fonts/#Segoe WP SemiBold" Click="CheckButtonClick"/>
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem Header="{x:Static Properties:Resources.AboutTabHeader}">
                <StackPanel>
                    <TextBlock Text="{x:Static Properties:Resources.AboutMeridian}" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="20" Foreground="Black"/>
                    <TextBlock FontFamily="../Fonts/#Segoe WP" Foreground="Black" Margin="0,10,0,0">
                        <Run Text="{x:Static Properties:Resources.Version}"/>
                        <Run Name="VersionString" Text="1.0.60.0 (Beta)"/>
                    </TextBlock>
                    <TextBlock Text="Copyright © Stealth 2011" FontFamily="../Fonts/#Segoe WP" Foreground="Black"/>
                    <TextBlock Text="{x:Static Properties:Resources.TermsString}" FontFamily="../Fonts/#Segoe WP" Foreground="Black" TextWrapping="Wrap"/>
                </StackPanel>
            </TabItem>
        </TabControl>

        <TextBlock Name="RestartRequiredText" Grid.Row="1" Text="{x:Static Properties:Resources.RestartRequired}" FontFamily="../Fonts/#Segoe WP SemiBold" FontSize="12" Foreground="Gray" VerticalAlignment="Bottom"  Margin="180,0,0,80" TextWrapping="Wrap" Visibility="Collapsed"/>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Margin="176,0,0,40"  Grid.Row="1">
            <Button Name="SaveButton" Content="{x:Static Properties:Resources.SaveButton}" FontFamily="../Fonts/#Segoe WP SemiBold" BorderThickness="2" BorderBrush="{StaticResource AccentColor}" Click="SaveButtonClick"/>
            <Button Name="CancelButton" Content="{x:Static Properties:Resources.CancelButton}" Margin="15,0,0,0" FontFamily="../Fonts/#Segoe WP SemiBold" Click="CancelButtonClick"/>
        </StackPanel>
    </Grid>
</UserControl>
